package com.luoyuanxiangvip.admin.controller;

import com.luoyuanxiangvip.admin.controller.support.BaseController;
import com.luoyuanxiangvip.core.entity.BizAnnouncement;
import com.luoyuanxiangvip.core.service.IBizAnnouncementService;
import com.luoyuanxiangvip.common.utils.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author luoyuanxiang <p>luoyuanxiangvip.com</p>
 * @since 2019/5/30
 */
@RestController
@RequestMapping("/admin/announcement")
@RequiresAuthentication
@Api(description = "公告管理")
public class BizAnnouncementController extends BaseController<IBizAnnouncementService, BizAnnouncement, Long> {

    @ApiOperation(value = "公告条数查询")
    @GetMapping("/announcementCount")
    public AjaxResult announcementCount() {
        int count = getiService().count();
        return AjaxResult.success("公告条数查询成功", count);
    }
}
